package hn.cch.spring_boot_webapps_war.controller;

import hn.cch.spring_boot_webapps_war.configuration.ParameterConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
public class ParameterController {

    private static Logger logger = LoggerFactory.getLogger(ParameterController.class);


    @Autowired
    private ParameterConfiguration parameterConfiguration;


    @GetMapping("get")
    @ResponseBody
    public String get(){
        logger.info("get");
        String parameter = parameterConfiguration.getParameter();
        logger.info("parameter:{}", parameter);
        return parameter;
    }

}
